<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>修改信息</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
    <!-- load css -->
    <link rel="stylesheet" th:href="@{/css/font.css}"/>
    <link rel="stylesheet" th:href="@{/css/xadmin.css}"/>
    <script type="text/javascript" th:src="@{/js/jquery.min.js}"></script>
    <script type="text/javascript" th:src="@{/js/layui/layui.js}" charset="utf-8"></script>
    <script type="text/javascript" th:src="@{/js/xadmin.js}"></script>
</head>
<body>
<div class="x-body">
    <form class="layui-form">
        <input type="hidden" name="id" th:value="${paypool.id}">
        <div class="layui-form-item">
            <label for="pay_type" class="layui-form-label">
                <span class="x-red"></span>支付类型
            </label>
            <div class="layui-input-inline">
                <select id="pay_type" name="pay_type" lay-verify="required" th:value="${paypool.pay_type}">
                    <option value="alipay">支付宝</option>
                    <option value="wechat">微信</option>
                </select>
            </div>
            <div class="layui-form-mid layui-word-aux">
                <span class="x-red">*</span>
            </div>
        </div>
        <div class="layui-form-item">
            <label for="amount" class="layui-form-label">
                <span class="x-red"></span>金额
            </label>
            <div class="layui-input-inline">
                <input type="text" id="amount" disabled name="amount" required="" lay-verify="required"
                       th:value="${paypool.amount}"
                       autocomplete="off" class="layui-input">
            </div>
<!--            <div class="layui-form-mid layui-word-aux">-->
<!--                <span class="x-red">*</span>-->
<!--            </div>-->
        </div>
        <div class="layui-form-item">
            <label for="pay_url_count" class="layui-form-label">
                <span class="x-red"></span>产码数量
            </label>
            <div class="layui-input-inline">
                <input type="text" id="pay_url_count" name="pay_url_count" required="" lay-verify="number"
                       th:value="${paypool.pay_url_count}"
                       autocomplete="off" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">
                <span class="x-red">*</span>
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label for="remarks" class="layui-form-label">
                备注
            </label>
            <div class="layui-input-block">
                <textarea placeholder="请输入内容" id="remarks" name="remarks" class="layui-textarea" style="width: 250px;"
                          th:text="${paypool.remarks}"></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <label for="L_repass" class="layui-form-label">
            </label>
            <button id="L_repass" class="layui-btn" lay-filter="add" lay-submit="">
                修改
            </button>
        </div>
    </form>
</div>
<script>
    layui.use(['form', 'layer'], function () {
        $ = layui.jquery;
        var form = layui.form
            , layer = layui.layer;

        //监听提交
        form.on('submit(add)', function (data) {
            $.post('[[@{/admin/paypool/update.html}]]', data.field, function (data) {
                layer.msg(data.msg);
                if (data.code == 0) {
                    layer.alert(data.msg, {icon: 6}, function () {
                        var index = parent.layer.getFrameIndex(window.name);
                        parent.layer.close(index);
                        window.parent.location.replace(window.parent.location.href);
                    });
                }
            });
            return false;
        });
    });
</script>
</body>
</html>
